Update schema attributes: rename SourceMetadata to Channel, #219
Merged
nikhilNava merged 1 commit intomainfrom Mar 23, 2026
Merged
Update schema attributes: rename SourceMetadata to Channel, #219nikhilNava merged 1 commit intomainfrom
nikhilNava merged 1 commit intomainfrom
Conversation
…ller constants to user.* namespace 1. Rename SourceMetadata class to Channel with simplified properties (Name, Link) 2. Update caller dimension constants: - CallerIdKey (microsoft.caller.id) -> UserIdKey (user.id) - CallerUpnKey (microsoft.caller.upn) -> UserEmailKey (user.email) - CallerNameKey (microsoft.caller.name) -> UserNameKey (user.name) 3. Update agent UPN constants: - AgentUPNKey (microsoft.agent.user.upn) -> AgentEmailKey (microsoft.agent.user.email) - CallerAgentUPNKey (microsoft.a365.caller.agent.user.upn) -> CallerAgentEmailKey (microsoft.a365.caller.agent.user.email) 4. Update all consumers: scopes, data builders, BaggageBuilder, ActivityProcessor, hosting extensions, middleware, ETW logger 5. Update all tests to use new naming Port of microsoft/Agent365-python#208 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
Pull request overview
Renames and reshapes observability schema attributes across the runtime/hosting stacks, aligning “caller” dimensions to OTel user.* attributes and replacing SourceMetadata with a simplified Channel contract.
Changes:
- Replaced
SourceMetadatawithChannel(name/link) in tracing contracts, scopes, DTO builders, ETW logger APIs, and hosting middleware/extensions. - Renamed schema attribute keys for caller and agent identity (
microsoft.caller.*→user.*,microsoft.agent.user.upn→microsoft.agent.user.email, etc.) and updated processors/builders accordingly. - Updated unit + integration tests to validate new attribute names and payload shapes.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Observability/Runtime/Tracing/Contracts/Request.cs | Replaces SourceMetadata with Channel and updates request contract accordingly. |
| src/Observability/Runtime/Tracing/Scopes/OpenTelemetryConstants.cs | Renames constants to user.* + agent/caller-agent email keys. |
| src/Observability/Runtime/Tracing/Scopes/OpenTelemetryScope.cs | Emits channel + user.* + agent email tags under new keys. |
| src/Observability/Runtime/Tracing/Scopes/InvokeAgentScope.cs | Switches request origin tag propagation to Channel and caller-agent email key. |
| src/Observability/Runtime/Tracing/Scopes/InferenceScope.cs | Updates scope API/implementation to accept Channel. |
| src/Observability/Runtime/Tracing/Scopes/ExecuteToolScope.cs | Updates scope API/implementation to accept Channel. |
| src/Observability/Runtime/Tracing/Scopes/OutputScope.cs | Updates scope API/implementation to accept Channel. |
| src/Observability/Runtime/Tracing/Processors/ActivityProcessor.cs | Updates allowlisted attribute keys to new agent email + user.* constants. |
| src/Observability/Runtime/DTOs/Builders/BaseDataBuilder.cs | Renames attribute emission helpers to channel + user.* + agent email keys. |
| src/Observability/Runtime/DTOs/Builders/ExecuteInferenceDataBuilder.cs | Switches builder inputs/attributes from source metadata to channel. |
| src/Observability/Runtime/DTOs/Builders/ExecuteToolDataBuilder.cs | Switches builder inputs/attributes from source metadata to channel. |
| src/Observability/Runtime/DTOs/Builders/OutputDataBuilder.cs | Switches builder inputs/attributes from source metadata to channel. |
| src/Observability/Runtime/Common/BaggageBuilder.cs | Writes baggage under new keys (agent email, user.*). |
| src/Observability/Runtime/Etw/IA365EtwLogger.cs | Updates ETW logger interface params/docs to Channel. |
| src/Observability/Runtime/Etw/A365EtwLogger.cs | Propagates Channel through ETW logger implementation. |
| src/Observability/Hosting/Middleware/OutputLoggingMiddleware.cs | Derives Channel from turn context and passes it into OutputScope. |
| src/Observability/Hosting/Extensions/TurnContextExtensions.cs | Renames “source metadata” baggage helpers to “channel” helpers and updates keys. |
| src/Observability/Hosting/Extensions/BaggageBuilderExtensions.cs | Updates extensions to set channel baggage via renamed helpers. |
| src/Observability/Hosting/Extensions/InvokeAgentScopeExtensions.cs | Updates extensions to record channel tags via renamed helpers. |
| src/Tests/.../Tracing/Scopes/OutputScopeTest.cs | Updates scope tests to validate channel + user.* tags. |
| src/Tests/.../Tracing/Scopes/InferenceScopeTest.cs | Updates scope tests to validate channel + user.* tags. |
| src/Tests/.../Tracing/Scopes/ExecuteToolScopeTest.cs | Updates scope tests to validate channel + user.* tags. |
| src/Tests/.../DTOs/Builders/*.cs | Updates builder tests for channel + new key names (agent email, user.*). |
| src/Tests/.../Etw/EtwLoggingBuilderTests.cs | Updates ETW payload tests for new caller keys and channel parameter naming. |
| src/Tests/.../Etw/EtwLoggerTests.cs | Updates ETW logger usage to pass channel:. |
| src/Tests/...IntegrationTests/Agent365Exporter*E2ETests.cs | Updates end-to-end payload assertions to user.* and new agent email key. |
| src/Tests/...Hosting.Tests/Middleware/BaggageTurnMiddlewareTests.cs | Updates baggage assertions to user.id. |
Contributor
|
@nikhilNava I've opened a new pull request, #220, to work on those changes. Once the pull request is ready, I'll request review from you. |
juliomenendez
approved these changes
Mar 23, 2026
fpfp100
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update caller constants to user.* namespace